﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Castle.ActiveRecord;

namespace ZDSoft.UPMS.Model.SystemPart
{
    /// <summary>
    /// 角色类
    /// </summary>
    /// Author：刘祖民
    /// CreateTime:2013-5-22

    [ActiveRecord]
    public class Role : ModelBase<Role>
    {
        /// <summary>
        /// 角色名
        /// </summary>
        [Property]
        public string Name { get; set; }

        /// <summary>
        /// 激活状态
        /// </summary>
        [Property]
        public bool IsActive { get; set; }

        [HasAndBelongsToMany(typeof(User), Table = "User_Manager", ColumnKey = "RoleID", ColumnRef = "UserID")]
        public IList<User> Users { get; set; }

        [HasAndBelongsToMany(typeof(SystemFunction), Table = "Role_SystemFuntion", ColumnKey = "RoleID", ColumnRef = "SystemFuntionID")]
        public IList<SystemFunction> SystemFunctions { get; set; }

        public string systemfunctionId { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        [Property]
        public string Remark { get; set; }
    }
}
